/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pt.iasd.youthshelter.logging;

import org.openide.util.lookup.ServiceProvider;
import org.slf4j.LoggerFactory;

/**
 *
 * @author Rui
 */
@ServiceProvider(service=ILoggingService.class)
public class LoggingServiceImpl implements ILoggingService{

    @Override
    public void trace(Class clazz, String msg) {
        LoggerFactory.getLogger(clazz).trace(msg);
    }

    @Override
    public void trace(Class clazz, Exception ex) {
        LoggerFactory.getLogger(clazz).trace(ex.getLocalizedMessage(), ex);
    }

    @Override
    public void trace(Class clazz, String msg, Exception ex) {
        LoggerFactory.getLogger(clazz).trace(msg, ex);
    }

    @Override
    public synchronized void debug(Class clazz, String msg) {
        LoggerFactory.getLogger(clazz).debug(msg);
    }

    @Override
    public synchronized void debug(Class clazz, Exception ex) {
        LoggerFactory.getLogger(clazz).debug(ex.getLocalizedMessage(), ex);
    }

    @Override
    public synchronized void debug(Class clazz, String msg, Exception ex) {
        LoggerFactory.getLogger(clazz).debug(msg, ex);
    }

    @Override
    public synchronized void info(Class clazz, String msg) {
        LoggerFactory.getLogger(clazz).info(msg);
    }

    @Override
    public synchronized void info(Class clazz, Exception ex) {
        LoggerFactory.getLogger(clazz).info(ex.getLocalizedMessage(), ex);
    }

    @Override
    public synchronized void info(Class clazz, String msg, Exception ex) {
        LoggerFactory.getLogger(clazz).info(msg, ex);
    }

    @Override
    public synchronized void warn(Class clazz, String msg) {
        LoggerFactory.getLogger(clazz).warn(msg);
    }

    @Override
    public synchronized void warn(Class clazz, Exception ex) {
        LoggerFactory.getLogger(clazz).warn(ex.getLocalizedMessage(), ex);
    }

    @Override
    public synchronized void warn(Class clazz, String msg, Exception ex) {
        LoggerFactory.getLogger(clazz).warn(msg, ex);
    }

    @Override
    public synchronized void error(Class clazz, String msg) {
        LoggerFactory.getLogger(clazz).error(msg);
    }

    @Override
    public synchronized void error(Class clazz, Exception ex) {
        LoggerFactory.getLogger(clazz).error(ex.getLocalizedMessage(), ex);
    }

    @Override
    public synchronized void error(Class clazz, String msg, Exception ex) {
        LoggerFactory.getLogger(clazz).error(msg, ex);
    }
}
